<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>

<!-- BEGIN SIDEBAR -->
   <li>
            <!-- BEGIN SIDEBAR TOGGLER BUTTON -->
            <div class="sidebar-toggler hidden-phone"></div> <!-- BEGIN SIDEBAR TOGGLER BUTTON -->
        </li>
        <li>
            <!-- BEGIN RESPONSIVE QUICK SEARCH FORM -->
            <form class="sidebar-search">
                <div class="input-box">
                    <a href="javascript:;" class="remove"></a> 
                 
                    <input type="text" id="TxtSearchModule" name="TxtSearchModule" value="<%=request.getParameter("moduleName") %>" placeholder="Search..." /> 
                    <input onclick="searchItemSidebarTest(TxtSearchModule.value  );" type="button" class="submit"
                                                                      value=" " />
                     
                </div>
            </form> <!-- END RESPONSIVE QUICK SEARCH FORM -->
        </li>
        
        <li
            <c:if test="${module == '0'}">
                class="active "
            </c:if>
            ><a href="/GedeonMvc/"> <i class="icon-home"></i> <span class="title">Home</span> 
                <span class="selected"></span>
            </a></li>    



        <c:forEach var="parenTab" items="${dataPatenTab}">

            <li 
                <c:forEach var="module" items="${dataModule}">
                    <c:forEach var="module" items="${dataModule}">
                        <c:if test="${parenTab.id == module.moduleParentId}">

                            <c:if test="${param.module == module.id}">
                                class="active"
                            </c:if>  

                        </c:if>

                    </c:forEach> 
                </c:forEach>
                > 
                <a href="#">
                    <i class="icon-stackexchange"></i>
                    <span class="title">${parenTab.parentTab.trim()}</span> 
                    <c:forEach var="module" items="${dataModule}"> 
                        <c:if test="${parenTab.id == module.moduleParentId}">
                         <c:if test="${param.module == module.id}">
                           <span class="selected"></span>
                         </c:if>  
                        </c:if>
                    </c:forEach>
                    <span class="arrow 
                          <c:forEach var="module" items="${dataModule}"> 
                            <c:if test="${parenTab.id == module.moduleParentId}">
                                <c:if test="${param.module == module.id}">
                                    open 
                                </c:if>  
                            </c:if>
                        </c:forEach>
                          "></span>

                </a>
                <ul class="sub-menu">
                    <c:forEach var="module" items="${dataModule}">

                        <c:if test="${parenTab.id == module.moduleParentId}">
                            <li 
                                <c:if test="${param.module == module.id}">
                                    class="active"  
                                </c:if>
                                >
                                <a href="<c:url value="/${module.moduleName.trim()}/index?module=${module.id}"/>">
                                    ${module.moduleName.trim()}
                                </a>
                            </li>

                        </c:if>

                    </c:forEach>
                </ul>      
            </li>

        </c:forEach> 
         
            <script>
                function searchItemSidebarTest(value  ){
                     
                     var requestUrl = '/GedeonMvc/sidebar_search'   ;
                      
     
              $.ajax({
        type: "POST",
        url: requestUrl,
        data: "moduleName="+value+"&module="+$("#TxtModuleSlider").val()  ,
        success: function(response){ 
        $('#sidebar').html(response);
        document.getElementById("TxtModuleSlider").focus();
        },
        error: function(e){
        alert('Error: ' + e);
        }
        });
                }
                
                </script>

